﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
using Ctrip.Automation.Framework.Lib;
using NUnit.Framework;
using System.IO;
using API.Taolx.Shopping.Common;
using Newtonsoft.Json.Linq;
using System.Diagnostics;
using System.Xml.Linq;
using Gallio.Framework;
using API.Taolx.Shopping.Business;
using System.Configuration;
using System.Xml;
using Ctrip.Automation.Framework.Attribute;

namespace API.Taolx.Shopping.TestCase.Api_Product
{
    public class ProductPriceDate
    {
        [Test]
        [Description("套餐价格日历接口，P1 case,验证IsSuccess as True")]
        [Priority(Priority.P1)]
        public void ProductPriceDateVerifyResultCode()
        {
            try
            {
                string requestStr = String.Empty;
                string Url = "http://shoppingapi.test2.taolx.com/api/Product/ProductPriceDate";
                string str = File.ReadAllText(string.Format("./Request_json/Api-Product/ProductPriceDate.json"));
                //准备数据
                PrepareRequest request = new PrepareRequest();
                requestStr = request.postAPIFunc(Url, str);

                //验证返回报文
                VerifyResponse verify = new VerifyResponse(requestStr);
                verify.VerifyResultDataByAttributeValue("True", "IsSuccess");
            }
            catch (Exception ex)
            {
                //检查是否因Service地址变更或停止工作造成异常
                CtripAssert.Contains(ex.Message, "Not Found");
            }

        }
    }
}
